// 自定义路由开始前操作
import { NavigationGuardNext, Route } from "vue-router";
import Vue from "vue";
import Store from "@/vue-config/store";

const beforeGrad = function(
  to: Route,
  from: Route,
  next: NavigationGuardNext<Vue>
) {
  if (to.name != "Login" && !Store.get<boolean>("system/isLogin")) {
    next("Login");
  } else {
    next();
  }
};

export default beforeGrad;
